package com.heima.utils.common;

import com.heima.model.user.pojos.ApUser;
import com.heima.model.wemedia.pojos.WmUser;

/**
 * @author rookie001
 * @creat 2023-06-07-11:04
 */
public class AppThreadLocalUtils {
    private final static ThreadLocal<ApUser> AP_USER_THREAD_LOCAL = new ThreadLocal<ApUser>();

    //添加用户
    public static void setUser(ApUser user) {
        AP_USER_THREAD_LOCAL.set(user);
    }

    //获取用户
    public static ApUser getUser() {
        return AP_USER_THREAD_LOCAL.get();
    }

    //清理用户
    public static void clear() {
        AP_USER_THREAD_LOCAL.remove();
    }
}